   <!DOCTYPE html>  
<html xmlns="http://www.w3.org/1999/xhtml"  
      xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4"">
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<head>
    <link rel="stylesheet" th:href="@{/resources/bootstrap-table-master/assets/bootstrap/css/bootstrap.min.css}"/>
        <link rel="stylesheet" th:href="@{/resources/bootstrap-table-master/src/bootstrap-table.css}"/>
     <script th:src="@{/resources/js/jquery-1.8.3.min.js}"></script>  
    <script th:src="@{/resources/bootstrap-table-master/src/bootstrap-table.js}"></script>
    <script th:src="@{/resources/bootstrap-table-master/toolbar/bootstrap-table-toolbar.js}"></script>
     <script th:src="@{/resources/bootstrap/js/comfirm.js}"></script>
</head>
<body>
                <div class="page-header">
                    <h1 id="pagination-table">角色管理</h1>
                </div>
				<div >
					 <div class="panel panel-default">
					 	<div class="panel-heading">
					    	<h3 class="panel-title text-center">已添加角色</h3>
					  	</div>
					  	<div class="panel-body">
					    	<div id="toolbar" class="btn-group" >
					    		<button id="btn_edit" type="button" class="btn btn-default" data-toggle="modal" href="sysRoleEdit" data-target="#myModal">
					   				<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>新增
					    		</button>
					    		<button id="btn_deletess" type="button" class="btn btn-default">
					   				<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>删除
					    		</button>
					    	</div>
							<table id="table"  data-toggle="table" data-url="sysRole_list.json"  data-search="true"   data-advanced-search="true" data-id-table="advancedTable" data-pagination="true" >
					    		<thead>
						        	<tr>
						           		<th data-checkbox="true"></th>
						            	<th data-field="seqidStr" data-align="center" data-sortable="true" >ID</th>
						            	<th data-field="name" data-align="center" data-sortable="true">名称</th>
						  				<th data-field="operation" data-align="center"  data-formatter="actionFormatter" data-events="actionEvents">操作</th>
						        	</tr>
					    		</thead>
							</table>
						<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
				    	</div>
						</div>
						</div>
					</div>
									

<script>
$(function() {
 Confirm.init('sm');
 


});

$(document).ready(function() {

	 $('#btn_deletess').click(function(){
	 	     Confirm.show('删除确认', '确定要删除吗', {
                'Delete': {
                    'primary': true,
                    'callback': function() {    
		         		var seqidss = getIdSelections();
		         		var seqidssss='';
		         		$.each(seqidss, function(index, value) { 
							seqidssss+=value+',';
						}); 
					  $.post("sysRole_del.json",{ids:seqidssss},function(result){
					    $('#table').bootstrapTable('refresh');  
					    Confirm.show('Message', '删除成功！');
					    
					  });
                    }
                }
            });
        		
	 });
 });

   function getIdSelections() {
        return $.map($('#table').bootstrapTable('getSelections'), function (row) {
            return row.seqidStr;
        });
    }
    
    window.actionEvents = {
        'click .mod': function(e, value, row, index) {    
        
            },
            'click .func': function(e, value, row, index) {    
                
            },   
        'click .delete' : function(e, value, row, index) {
        		 Confirm.show('删除确认', '确定要删除吗', {
                'Delete': {
                    'primary': true,
                    'callback': function() {    
		         		var seqids =row.seqid+',';
					  $.post("sysRole_del.json",{ids:seqids},function(result){
					    $('#table').bootstrapTable('refresh');  
					    Confirm.show('Message', '删除成功！');
					    
					  });
                    }
                }
            });
        		

            }
        };





function actionFormatter(value, row, index) {
    return '<a class="mod" data-toggle="modal" href="sysRoleEdit?seqid='+row.seqidStr+'" data-target="#myModal">修改</a> ' + '<a class="delete">删除</a> ' + ' <a class="func" data-toggle="modal" href="SysRoleFuncEdit?roleId='+row.seqidStr+'" data-target="#myModal">授权</a> ';
    }
</script>
	
	</body>
	</html>